package com.filter.filterdemo.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author luheng
 * @create 2019/5/14
 */
@RestController
@RequestMapping("/test")
public class TestController {

    /**
     * //使用HttpServletRequestWrapper重写Request请求参数生效
     * @param name
     * @return
     */
    @RequestMapping("/info")
    public String requestParam(@RequestParam String name){
        System.out.println("---" + name);
        return name;
    }

    /**
     * //使用HttpServletRequestWrapper重写Request请求参数不生效
     * @param name
     * @return
     */
    @RequestMapping("/info1/{name}")
    public String pathVariable(@PathVariable String name){
        System.out.println("---" + name);
        return name;
    }
}
